home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 January / CHIPCD1_98.iso / software / pelne / monkey / mlinux06.a02 / USR / LIB / MC / MC_MENU.{_5 < prev    next >
Text File  |  1996-05-24  |  6KB  |  237 lines

  1. shell_patterns=0
  2. + ! t t
  3. @       Do something on the current file
  4.     %{Enter command} ./%f
  5.  
  6. + t t
  7. @       Do something on the tagged files
  8.     set %u; CMD="%{Enter command}"
  9.     while [ -n "$1" ]; do
  10.       $CMD $1 || echo tag $1 >>$MC_CONTROL_FILE
  11.       shift
  12.     done
  13.     
  14.  
  15. 0       Edit a bug report and send it to root
  16.         ${EDITOR-vi} /tmp/mail.$$
  17.     test -r /tmp/mail.$$ && mail root < /tmp/mail.$$
  18.     rm -f /tmp/mail.$$
  19.  
  20. =+ f \.1$ | f \.3$ | f \.4$ | f \.5$ | f \.6$ | f \.7$ | f \.8$ | f \.man$ & t r
  21. 1       Display the file with roff -man
  22.     nroff -man %f | less
  23.  
  24. 2       Call the info hypertext browser
  25.         info
  26.  
  27. = t d
  28. 3       Make a release of the current subdirectory
  29.     Pwd=`basename %d /`
  30.     echo -n "Name of the distribution file (without extension) [$Pwd]: "
  31.     read tar
  32.         [ -z $tar ] && tar=$Pwd
  33.     cd .. && tar chf - $Pwd | gzip -f9 > $tar.tar.gz
  34.     echo ../${tar}.tar.gz created.
  35. #       tar=%{Name of the distribution file (without extension)}
  36.  
  37. = f \.c$ & t r
  38. + f \.c$ & t r & ! t t
  39. 5       Compile and link current .c file
  40.         make `basename %f .c` 2>/dev/null || cc -O -o `basename %f .c` %f
  41.  
  42. + t r & ! t t
  43. a       Append file to opposite
  44.     cat %f >>%D/%f
  45.  
  46. + t t
  47. A       Append files to opposite files
  48.     set %u
  49.     while [ -n "$1" ]; do
  50.       cat $1 >>%D/$1 || echo tag $1 >>$MC_CONTROL_FILE
  51.       shift
  52.     done
  53.  
  54. + t r & ! t t
  55. d       Delete file if a copy exists in the other directory.
  56.     if [ "%d" = "%D" ]; then
  57.       echo "The two directores must be different"
  58.       exit 1
  59.     fi
  60.       if [ -f %D/%f ]; then        # if two of them, then
  61.           if cmp -s %D/%f %f; then
  62.             rm %f && echo %f: DELETED
  63.           else
  64.             echo "%f and %D/%f differ: NOT deleted"
  65.             echo -n "Press RETURN "
  66.             read key
  67.           fi
  68.     else
  69.       echo %f: No copy in %D/%f: NOT deleted.
  70.         fi
  71.  
  72. + t t
  73. D       Delete tagged files if a copy exists in the other directory.
  74.     if [ "%d" = "%D" ]; then
  75.       echo "The two directores must be different"
  76.       exit 1
  77.     fi 
  78.         for i in %t
  79.         do 
  80.           if [ -f %D/$i ]; then
  81.             SUM1="`sum $i`"
  82.             SUM2="`sum %D/$i`"
  83.             if [ "$SUM1" = "$SUM2" ]; then
  84.           rm $i && echo ${i}: DELETED
  85.         else
  86.           echo $i and %D/$i differ: NOT deleted.
  87.         fi
  88.       else
  89.         echo %f has no copy in %D/%f: NOT deleted.
  90.           fi
  91.         done
  92.  
  93. = f \.gz$ & t r
  94. + ! t t
  95. n       Inspect gzip'ed newsbatch file
  96.         dd if=%f bs=1 skip=12|zcat|${PAGER-more}
  97.         # assuming the cunbatch header is 12 bytes long.
  98.  
  99. = t r &
  100. + ! t t
  101. h       Strip headers from current newsarticle
  102.     CHECK=`sed 1q < %f|awk '{print $1}'` 2>/dev/null
  103.     case $CHECK in
  104.       Newsgroups:|Path:)
  105.           cp %f /tmp/%f.$$ && sed '/^'"$CHECK"' /,/^$/d' /tmp/%f.$$ > %f
  106.               [ "$?" = "0" ] && rm /tmp/%f.$$
  107.           echo %f: header removed
  108.         ;;
  109.       *)
  110.           echo %f is not a news article.
  111.         ;;
  112.     esac
  113.  
  114. + t t
  115. H       Strip headers from the marked newsarticles
  116.     set %u
  117.     while [ -n "$1" ]; do
  118.       CHECK=`sed 1q < $1|awk '{print $1}'` 2>/dev/null
  119.       WFILE=/tmp/${1}.$$
  120.       case $CHECK in
  121.         Newsgroups:|Path:)
  122.           cp $1 $WFILE && sed '/^'"$CHECK"' /,/^$/d' $WFILE > $1
  123.               if [ "$?" = "0" ]; then
  124.         rm $WFILE; echo $1 header removed. OK.
  125.           else
  126.             echo tag $1 >>$MC_CONTROL_FILE
  127.         echo "Oops! Please check $1 against $WFILE"
  128.           fi
  129.         ;;
  130.         *)
  131.           echo $1 skipped: Not a news article.
  132.           echo tag $1 >>$MC_CONTROL_FILE
  133.         ;;
  134.       esac
  135.       shift
  136.     done
  137.  
  138. = t r
  139. + ! t t
  140. r       Copy file to remote host
  141.     echo -n "To which host?: "
  142.         read Host
  143.         echo -n "To which directory on $Host?: "
  144.         read Dir
  145.         rcp -p %f ${Host}:$Dir
  146.  
  147. + t t
  148. R       Copy files to remote host (no error checking)
  149.     echo -n "Copy files to which host?: "
  150.         read Host
  151.         echo -n "To which directory on $Host? :"
  152.         read Dir
  153.         rcp -pr %u ${Host}:$Dir
  154.  
  155. = f \.tex$ & t r
  156. + f \.tex$ & t r & ! t t
  157. t       Run latex on file and show it with xdvi
  158.         latex %f && xdvi `basename %f .tex`.dvi
  159.  
  160. =+ f ^part | f ^Part | f uue & t r
  161. + t t
  162. U       Uudecode marked news articles (needs work)
  163.     set %u
  164.         (
  165.     while [ -n "$1" ]; do # strip headers
  166.           FIRST=`sed 1q < $1|awk '{print $1}'`
  167.       cat $1 | sed '/^'"$FIRST"' /,/^$/d'; shift
  168.     done
  169.     ) |sed '/^$/d' |sed -n '/^begin 6/,/^end$/p' | uudecode
  170.     if [ "$?" != "0" ]; then
  171.       echo "Could not decode %t"
  172.       for i in %t; do
  173.         echo tag $i >>$MC_CONTROL_FILE
  174.         shift
  175.       done
  176.     fi
  177.     echo "Please test the output file before deleting anything"
  178.  
  179. =+ f \.tar\.gz$ | f \.tar\.z$ | f \.tgz$ | f \.tpz$ | f \.tar\.Z$ & t r
  180. x       Extract the contents of a compressed tar file
  181.     tar xzvf %f
  182.  
  183. = t r
  184. + ! t t
  185. y       Gzip or gunzip current file
  186.         unset DECOMP
  187.     echo %f|egrep -q "\.gz$|\.z$|\.Z$" && DECOMP=-d
  188.         gzip $DECOMP -v %f
  189.  
  190. + t t
  191. Y       Gzip or gunzip tagged files
  192.         for i in %t
  193.         do
  194.           unset DECOMP
  195.       echo $i|egrep -q "\.gz$|\.z$|\.Z$" && DECOMP=-d
  196.           gzip $DECOMP -v $i
  197.         done
  198.  
  199. + f \.tar.gz$ | f \.tgz$ | f \.tpz$ | f \.tar.Z$ | f \.tar.z$ & t r & ! t t
  200. z       Extract compressed tar file to subdirectory
  201.         unset D
  202.     echo %f|egrep -q "\.tar.gz$" && EXT=tar_gz
  203.     echo %f|egrep -q "\.tgz$"    && EXT=tgz
  204.     echo %f|egrep -q "\.tpz$"    && EXT=tpz
  205.     echo %f|egrep -q "\.tar.Z$"    && EXT=tar_Z
  206.     echo %f|egrep -q "\.tar.z$"    && EXT=tar_z
  207.         case $EXT in
  208.           tar_gz) D="`basename %f .tar.gz`";;
  209.           tgz)    D="`basename %f .tgz`";;
  210.           tpz)    D="`basename %f .tpz`";;
  211.           tar_Z)  D="`basename %f .tar.Z`";;
  212.           tar_z)  D="`basename %f .tar.z`";;
  213.         esac
  214.         mkdir $D; cd $D && tar xvzof ../%f
  215.  
  216. + t t
  217. Z       Extract compressed tar files to subdirectories
  218.     set %u
  219.     while [ -n "$1" ]
  220.         do
  221.           unset D
  222.       echo $1|egrep -q "\.tar.gz$" && EXT=tar_gz
  223.       echo $1|egrep -q "\.tgz$"    && EXT=tgz
  224.       echo $1|egrep -q "\.tpz$"    && EXT=tpz
  225.       echo %f|egrep -q "\.tar.Z$"    && EXT=tar_Z
  226.       echo %f|egrep -q "\.tar.z$"    && EXT=tar_z
  227.           case $EXT in
  228.             tar_gz) D="`basename $1 .tar.gz`";;
  229.             tgz)    D="`basename $1 .tgz`";;
  230.             tpz)    D="`basename $1 .tpz`";;
  231.             tar_Z)  D="`basename %f .tar.Z`";;
  232.             tar_z)  D="`basename %f .tar.z`";;
  233.           esac
  234.           mkdir $D; (cd $D && tar xvzof ../$1)||echo tag $1 >>$MC_CONTROL_FILE
  235.       shift
  236.         done
  237.